Learn R Programming

seem (version 1.0)

Mat projection: Matrix projection

Description

Simulates structured population by projection matrix

Usage

sim.proj(t, x0, proj.mat, vars.plot, tunit, xunit, pdfout = F)

Arguments

t
projection times
x0
initial condition
proj.mat
projection matrix
vars.plot
variables to plot
tunit
units for time
xunit
units for population density
pdfout
switch to produce pdf files, (optional, default F)

Value

  • xresults for all age classes
  • xpresults for all age classes, as proportion of total
  • xsresults for all age classes, as proportion of last class
  • lambdaratio of two consecutive values of xtot
  • xtottotal population

Details

To perform the simulation, we write a loop for time to iterate the multiplication of the matrix proj.mat by the state vector x. As time progresses in the loop, it calculates the total population xtot, the proportions xp in each class with respect to the total, and an approximation lambda to the dominant eigenvalue as the ratio of the total population at adjacent times, and the population is scaled with respect to the last class. Note that the calculation of lambda is the ratio of current year to previous.

References

Acevedo M.F. 2012. Simulation of Ecological and Environmental Models. CRC Press.

See Also

Simulation functions sim.comp, sim.mruns, sim.rnum, sim

Examples

Run this code
P <- matrix(c(0,2,3, 0.5,0,0, 0,0.5,0), byrow=TRUE, ncol=3)
x0 <- c(100,50,25); xunit="(Indiv)"
t=seq(0,10,1); tunit="(Year)"
x <- sim.proj(t, x0, P, vars.plot=c(1:3),tunit, xunit)

Run the code above in your browser using DataLab